#!/usr/bin/env python
# coding=utf-8

"""
@author: xu
@license: MIT
@file: exp1.py
@date: 2023/11/7 21:07
@desc: 
"""

from unitxu.io import Gribfile
from unitxu.io import Nc, NCformat
def testgrib():
    gf = '~/project/unitxu/dist/W_NAFP_C_ECMF_20211019180051_P_C1D10191200102112001'
    gs = Gribfile(gf, **{'Relative humidity': 'R', 'Visibility': 'VIS', 'Temperature': 'T'})
    # gs.show_grib()
    print(gs.get_gribs())
    gs.resolve_target(savetype=2, output_folder='./tiff')


def testnc():
    nf = '~/project/unitxu/dist/wrfout_d01_2022-06-17_00:00:00.nc'
    nc = Nc(nf, './png', ncformat=NCformat(**{'MAPFAC_U': 'U', 'grid_map_type': 2}))
    nc.show_nc()
    nc.resolve_target(savetype=2)

if __name__ == '__main__':
    testnc()